const Router = require('koa-router')
const { Pexels } = require('../../models/pexels')
const router = new Router({
  prefix: '/v1/pexels',
})
router.get('/list', async (ctx, next) => {
  const { pageIndex, pageSize, categoryid } = ctx.request.query
  const list = await Pexels.getPexelsList(Number(pageIndex || 1), Number(pageSize || 20), categoryid || '')
  ctx.body = {
    code: 200,
    data: list,
  }
})
module.exports = router

